package com.cskaoyan.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * @author stone
 * @date 2022/06/01 23:46
 */
@RestController
public class LoginController {


    @RequestMapping("login")
    public String login(String username, String password, HttpSession session) {
        if ("songge".equals(username) && "niupi".equals(password)) {
            session.setAttribute("username", username);
            return "ok";
        }
        return "fail";
    }

    @RequestMapping("hello")
    public String hello() {
        return "hello";
    }
}
